<?php
	/**
	 *	Copyright (c) TeamFlamingo And gray 2004-2009
	 *	www.me-live.com.cn / www.i-gray.cn
	 *
	 *	[ WARNING ]
	 *		This is NOT a freeware!
	 *		You MUST get author's authorization before using it!
	 *	[ WARNING ]
	 *
	 *	Name : updata.h.php / Development Code Evolve
	 *	Created / Modify : 2010-2-17 / --
	 */

	if( !defined( 'IN_TEAME' ) )
	{
		exit( 'Access Denied' );
	}

	//	[CH]	更新文章浏览次数
	function	updataReadData( $tid )
	{
		global	$db, $MDK;
		$visit	=	false;

		if( isset( $_SERVER['HTTP_REFERER'] ) )
		{
			//	[CH]	获取前一个页面请求
			$Url	=	parse_url( $_SERVER['HTTP_REFERER'] );
			if( isset( $Url['query'] ) )
			{
				parse_str( $Url['query'], $tempArr );
				$visit	=	( isset( $tempArr['t'] ) && $tempArr['t'] == $tid ) ? TRUE : FALSE;
			}
			else
			{
				$visit	=	false;
			}
		}
		else
		{
			$visit	=	false;
		}

		if( !$visit )
			return	$db->query( "UPDATE `mdk_posts` SET `read` = `read` + '1' WHERE `tid` = '{$tid}' LIMIT 1" );
	}
?>